﻿@{
    Layout = null;
}

<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>Login</title>
    <script src="~/Resources/bootstrap-3.3.5/js/bootstrap.min.js"></script>
    <link href="~/Resources/bootstrap-3.3.5/css/bootstrap.min.css" rel="stylesheet" />
    <link href="~/resources/AdminTLE/css/AdminLTE.min.css" rel="stylesheet" />
    <link href="~/resources/AdminTLE/css/skins/skin-blue-light.min.css" rel="stylesheet" />
</head>
<body class="hold-transition login-page">
    <div class="login-box">
        <div class="login-logo">
            <b>Technical Level Evaluation</b>
        </div>
        <!-- /.login-logo -->
        <div class="login-box-body">
            <p class="login-box-msg">Enter your code1 and password</p>
            <form id="formLogin" action="/Account/CustomsLogin" method="post" onsubmit="return check()">
                <div class="form-group has-feedback">
                    <input id="CodeID" name="CodeID" type="text" class="form-control" placeholder="CodeNo" data-container="body" data-toggle="popover" data-placement="right"
                           data-content="Please enter CodeID！" value="@ViewData["LoginCodeID"]">
                    <span class="glyphicon glyphicon-user form-control-feedback"></span>
                </div>
                <div class="form-group has-feedback">
                    <input id="Password" name="Password" type="password" class="form-control" placeholder="Password" data-container="body" data-toggle="popover" data-placement="right"
                           data-content="Please enter Password！" value="@ViewData["LoginPassword"]">
                    <span class="glyphicon glyphicon-lock form-control-feedback"></span>
                </div>
                <div class="form-group has-feedback">

                    <select class="form-control">
                        <option value="">Select User Type</option>
                        <option value="saab">Philips Employee</option>
                        <option value="opel">Non-Philips Employee</option>
                        <option value="audi">Super Admin</option>
                    </select>
                    
                </div>
                @*<div class="form-group has-feedback">
                    <div class="col-xs-6">
                        <div class="checkbox icheck">
                            <label>
                                <input id="RememberMe" name="RememberMe" type="checkbox" @(ViewData["LoginRememberMe"] != null && ViewData["LoginRememberMe"].ToString() == "on" ? "checked" : "")>
                                Remember Me
                            </label>
                        </div>
                    </div>
                    <!-- /.col -->
                    <div class="col-xs-12" style="margin-top: 10px;">
                        <label id="divErrorTip"></label>
                    </div>
                    <!-- /.col -->
                </div>*@
                <div class="row">
                    <div class="col-xs-12">
                        <button type="submit" class="btn btn-primary btn-block btn-flat">Sign In</button>
                    </div>
                    <!-- /.col -->
                </div>
            </form>
        </div>
        <!-- /.login-box-body -->
    </div>
    <!-- /.login-box -->
    @Html.Hidden("hidLoginResult", ViewData["LoginResult"]);
    <script type="text/javascript">
        $(function () {
            $('input').iCheck({
                checkboxClass: 'icheckbox_square-blue',
                radioClass: 'iradio_square-blue',
                increaseArea: '20%' // optional
            });
            if ($("#CodeID").val().trim() != "" && $("#Password").val().trim() != "") {
                $("#formLogin").submit();
            }

            if ($("#hidLoginResult").val() == "err") {
                $("#divErrorTip").html("The CodeID or Password is incorrect!");
            }
            else if ($("#hidLoginResult").val() == "errDomainCheck") {
                $("#divErrorTip").html("The CodeID or Password is incorrect!");
            }
            //$("#btnLoginSubmit").click(function () {
            //    $.ajax({
            //        url: "",
            //        type: "post",
            //        data: { CodeID: $("#CodeID").val(), Password: $("#Password").val() },
            //        dataType: "json",
            //        success: function (data) {
            //            alert(data);
            //            //$("#formLogin").submit();
            //        },
            //        error: function () {
            //            alert("cuowu");
            //        }
            //    });
            //});
        });

        function check() {
            if ($("#CodeID").val() == "") {
                $("#CodeID").popover("show");
                return false;
            }
            else {
                $("#CodeID").popover("hide");
            }
            if ($("#Password").val() == "") {
                $("#Password").popover("show");
                return false;
            }
            else {
                $("#Password").popover("hide");
            }
        }
    </script>
</body>
</html>
